<?php

namespace app\admin\model;

use think\Model;

class OrderModel extends Model
{
    //表名
    protected $name = 'order';
    //主键
    protected $pk = 'id';

    //关联商品模型
    public function goods()
    {
        return $this->belongsTo('GoodsModel', 'goods_id', 'id')->removeOption('soft_delete');
    }

    //关联用户模型
    public function user()
    {
        return $this->belongsTo('UserModel', 'u_id', 'id');
    }
}
